#pragma once

#include <iostream>
#include <vector>
#include <string>
#include <memory>


#include "WordReport.h"


class WordCache {
public:
    static const int ADD_SUCCESS = 0;
    //word alread existed in cache.
    static const int ADD_ERROR_DUPLICATED = -1;
    //worng word been typed, couldn't find it from dictionary.
    static const int ADD_ERROR_WRONG = -2;

public:
    static std::shared_ptr<WordCache> Create();
	virtual int AddWord(const std::string& word) = 0;
    virtual void SetReport(std::shared_ptr<WordReport> report);
    virtual void Report() = 0;
    virtual std::vector<std::string> GetWords() = 0;

    virtual void Clear() = 0;

public:
    virtual ~WordCache()
    {
    }

protected:
    std::shared_ptr<WordReport> m_report;
};